package com.beans;

import org.springframework.stereotype.Controller;

import javax.annotation.Resource;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: fzykd
 * Date: 2022-10-01
 * Time: 20:33
 */


@Controller
public class UserController4 {
    private UserService userService;

    //这是构造方法注入
    @Resource
    public void setUserService(UserService userService){
        this.userService = userService;
    }

    public void sayHi(){
        userService.sayHi();
    }
}
